<%@page import="java.util.List"%>
<%@page import="entities.ApplicationConfig"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.TreeMap"%>
<%@page import="helpers.UrlHelper"%>

<%
TreeMap check = (TreeMap) request.getAttribute("check");
String success = (String) request.getAttribute("success");
ApplicationConfig appConfig = (ApplicationConfig) request.getAttribute("appConfig");
String form = (String) request.getAttribute("form");
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/admin/layouts/header.jsp" />

<script type="text/javascript" src="/admin/js/application_config_form.js"></script>

		<div class="maincontent noright">
        	<div class="maincontentinner">
                <ul class="maintabmenu multipletabmenu">
                	<li class="current"><a href="/admin/appconfig/edit/<%=appConfig.getApplicationId()%>">Update Application Config</a></li>
                	<li><a href="/admin/appmapping/list/<%=appConfig.getApplicationId()%>">Domain Manager</a></li>
                	<li><a href="/admin/category/list/<%=appConfig.getApplicationId()%>">Category Manager</a></li>
                	<li><a href="/admin/article/list/<%=appConfig.getApplicationId()%>">Article Manager</a></li>
                	<li><a href="/admin/site/list/<%=appConfig.getApplicationId()%>">List Sites</a></li>
                </ul><!--maintabmenu-->
                
                <div class="content">
					<jsp:include page="/admin/elements/message_box.jsp" />
                    <div class="contenttitle">
                    	<h2 class="form"><span>Information</span></h2>
                    </div><!--contenttitle-->
            
                    <form method="post" action="#" class="stdform stdform2" id="edit_config_form">
                    	<p>
                        	<label>Application Id</label>
                            <span class="field">
                            	<input type="text" class="smallinput" name="applicationId" id="a_applicationId" value="<%=appConfig.getApplicationId() %>" disabled="disabled">
                            </span>
                        </p>
                        
                        <p>
                        	<label>Title</label>
                            <span class="field">
                            	<input type="text" class="mediuminput" name="title" id="a_title" value="<%=appConfig.getTitle() != null ? appConfig.getTitle() : "" %>">
                            	<% if (check.get("title") != null) { %>
									<label for="a_title" generated="true" class="error"><%=check.get("title") %></label>
								<% } %>
                            </span>
                        </p>
                        
                        <p>
                        	<label>Description</label>
                            <span class="field">
                            	<textarea id="a_description" class="longinput" name="description"  rows="5" cols="80"><%=appConfig.getDescription()!= null ? appConfig.getDescription() : "" %></textarea>
                            	<% if (check.get("description") != null) { %>
									<label for="a_description" generated="true" class="error"><%=check.get("description") %></label>
								<% } %>
                            </span>
                        </p>
                        
                        <p>
                        	<label>Keyword</label>
                            <span class="field">
                            	<input type="text" class="mediuminput" name="keyword" id="a_keyword" value="<%=appConfig.getKeyword()!= null ? appConfig.getKeyword() : "" %>">
                            	<% if (check.get("keyword") != null) { %>
									<label for="a_keyword" generated="true" class="error"><%=check.get("keyword") %></label>
								<% } %>
                            </span>
                        </p>
                        
                        <p>
                        	<label>Template Id</label>
                            <span class="field">
                            	<select id="a_template" name="templateId">
                            		<option value="classic" selected="selected">Classic template</option>
                            	</select>
                            	<% if (check.get("templateId") != null) { %>
									<label for="a_templateId" generated="true" class="error"><%=check.get("templateId") %></label>
								<% } %>
                            </span>
                        </p>
                        
                        <p>
                        	<label>Email Admin</label>
                            <span class="field">
                            	<input type="text" class="smallinput" name="emailAdmin" id="a_emailAdmin" value="<%=appConfig.getEmailAdmin()!= null ? appConfig.getEmailAdmin() : "" %>">
                            	<% if (check.get("emailAdmin") != null) { %>
									<label for="a_emailAdmin" generated="true" class="error"><%=check.get("emailAdmin") %></label>
								<% } %>
                            </span>
                        </p>
                        
                        <p>
                        	<label>Google Custom Search Id</label>
                            <span class="field">
                            	<input type="text" class="smallinput" name="cxGoogleSearch" id="a_cxGoogleSearch" value="<%=appConfig.getCxGoogleSearch()!= null ? appConfig.getCxGoogleSearch() : "" %>">
                            	<% if (check.get("cxGoogleSearch") != null) { %>
									<label for="a_cxGoogleSearch" generated="true" class="error"><%=check.get("cxGoogleSearch") %></label>
								<% } %>
                            </span>
                        </p>
                        
                        <p class="stdformbutton">
                        	<button class="submit radius2">Submit</button>
                            <input type="reset" value="Reset" class="reset radius2">
                        </p>
                        
                    </form>
                    
                    <br clear="all">
                    
                </div><!--content-->
                
            </div><!--maincontentinner-->
            
            <jsp:include page="/admin/elements/copyright.jsp" />
            
        </div>

<jsp:include page="/admin/layouts/footer.jsp" />